<form ngForm>
  <div nz-row [nzGutter]="24">
    <div nz-col [nzSpan]="24" class="search-area">
      <button nz-button (click)="search()">Search</button>
      <button nz-button [nzType]="'primary'" routerLink="./edit">Add</button>
    </div>
  </div>
</form>

<nz-table #smallTable [nzData]="menus" nzSize="small" [nzFrontPagination]="false"
          [nzLoading]="loading" [nzLoadingDelay]="300">
  <thead>
  <tr>
    <th>名字</th>
    <th>PATH</th>
    <th>操作</th>
  </tr>
  </thead>
  <tbody>
  <ng-container *ngFor="let data of smallTable.data">
    <tr *ngIf="isShow(data)">
      <td [nzIndentSize]="data.level * 15" [(nzExpand)]="data.expand"
          [nzShowExpand]="!!data.children">
        {{ data.menuName }}</td>
      <td>{{ data.path }}</td>
      <td>
        <button nz-button nzType="link" nzSize="small" routerLink="./edit" [queryParams]="{pid:data.pid}">
          <i nz-icon nzType="edit" nzTheme="outline"></i>edit
        </button>
        <button nz-button nzType="link" nzDanger nzSize="small"
                nz-popconfirm [nzPopconfirmTitle]="'确认删除菜单:'+data.menuName+'及菜子菜单?'" (nzOnConfirm)="delete(data.pid)">
          <i nz-icon nzType="delete" nzTheme="outline"></i>delete
        </button>
        <button nz-button nzType="link" nzSize="small" routerLink="./edit" *ngIf="!data.parentId"
                [queryParams]="{parentId:data.pid,parentName:data.menuName}">
          <i nz-icon nzType="subnode" nzTheme="outline"></i>subnode
        </button>
      </td>
    </tr>
  </ng-container>
  </tbody>
</nz-table>
